#ifndef CIRCULOS_H
#define CIRCULOS_H

/** Circulo a partir de 3 pontos *********
http://mathworld.wolfram.com/Circle.html
******************************************/

#include "GLDrawble.h"
#include "structs.h"
#include "Point.h"
#include <QList>
#include <cmath> //Para usar "sqrt", "pow" e "fabs".

struct circulo
{
    circulo(double vx, double vy, double vr): x(vx),y(vy),r(vr){}
    double x;
    double y;
    double r;
};

class circulos : public GLDrawble
{
private:
    QList<circulo> lista_circulos;
    void imprimir(const double mat[3][3]) const;
    double determinanteSarrus(const double mat[3][3]) const;
    circulo calcularCentroRaio(const Point& p1, const Point& p2, const Point& p3);
    void desenhaCirculo(double x, double y, double raio);

public:
    circulos(const QList<Point>& vertices, const QList<triangulo>& triangulos);
    const QList<circulo>& getCirculos() const;
    void draw();
};

#endif // CIRCULOS_H
